import 'dart:ffi';

import 'package:flutter_easy_permission/easy_permissions.dart';

class PermissionsUtils {
  static Future<bool> checkPermission(List<Permissions> perms, List<PermissionGroup> permsGroup) async {

    bool ret = await FlutterEasyPermission.has(
        perms: perms, permsGroup: permsGroup);
    if(!ret){
      FlutterEasyPermission.request(
          perms: perms, permsGroup: permsGroup, rationale: "为保证正常使用，请同意定位与读写权限");
      return false;
    }
    return true;
  }
}
